package com.practice.thread;

import java.io.File;

public class Str {
	public static void main(String[] args) {
		File f = new File("D:\\demo");
		dir(f,0);

	}

	private static String getLevel(int level) {
		StringBuilder sb = new StringBuilder();
		for (int i = 0; 0 <= level; i++) {
			sb.append("");
		}
		return sb.toString();
	}
	private static void dir(File f,int level){
		System.out.println(getLevel(level)+f);
		level++;
		System.out.println(level);
		File[] files =f.listFiles();
		for(File fe:files){
			if(!fe.isHidden()){
				if(fe.isDirectory()){
					dir(fe,level);
				}else{
					System.out.println(getLevel(level+1)+fe);
				}
			}
			
		}
	}
}
